package com.fs.spring.example01.model;

import com.fs.common.entity.LongIdEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.*;

/**
 * @author shuai.fang
 * @date：2017-08-02
 * @description：
 */
public class Person extends LongIdEntity implements BeanFactoryAware, BeanNameAware, InitializingBean, DisposableBean {

	private static Logger logger = LoggerFactory.getLogger(Person.class);

	private String name;

	public Person() {
		logger.info("调用Person()构造函数");
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		logger.info("调用Person#setName()设置属性");
		this.name = name;
	}

	public String introduce() {
		return "name is " + name;
	}

	public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
		logger.info("调用BeanFactoryAware#setBeanFactory -> {}", beanFactory);
	}

	public void setBeanName(String name) {
		logger.info("调用BeanNameAware#setBeanName -> {}", name);
	}

	public void destroy() throws Exception {
		logger.info("调用DisposableBean#destroy");
	}

	public void afterPropertiesSet() throws Exception {
		logger.info("调用InitializingBean#afterPropertiesSet");
	}

	public void init() {
		logger.info("Person#init");
	}

	public void onDestory() {
		logger.info("Person#onDestory");
	}




















}
